<template>
  <div style="height: 100%;width: 100%">
    <p v-if="editOpen" style="color: red;font-weight: bold">如需修改经费来源,请切换到【{{ phaseType ==='1'?'基本信息':'项目信息表' }}】修改并提交。</p>
    <t-row>
      <t-col :span="10"></t-col>
      <t-col style="text-align: right" :span="2">单位：万元</t-col>
    </t-row>
    <t-table v-if="editOpen" rowKey="index"
             :headerAffixedTop="{ offsetTop: offsetTop, container: getContainer }" bordered :data="data"
             :columns="columns">
      <template #subject="{ row,rowIndex }">
        <div v-if="[0,6].includes(rowIndex)" style="display: flex;justify-content: flex-start">
          {{ row.subject }}
        </div>
        <div v-else-if="[7,11].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 16px">
          {{ row.subject }}
        </div>
        <div v-else-if="[1,2].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;align-items: center;margin-left: 28px">
          {{ row.subject }}
        </div>
        <div v-else-if="[8, 9,10,12,13].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;align-items: center;margin-left: 40px">
          {{ row.subject }}
        </div>
        <div v-else-if="[3].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 50px">
          {{ row.subject }}
        </div>
        <div v-else-if="[4,5].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 92px">
          {{ row.subject }}
        </div>

      </template>
      <template #hj="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">
          <div
            :style="{color:((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2))  + Number(((formData.outTbGlBudget || 0)*100).toFixed(2))  + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)) ) / 100)   !== Number(adviceFunding)?'red':''}">
            {{
              Number(adviceFunding || 0)
            }}
          </div>

        </div>
        <div v-if="[1].includes(rowIndex)">
          {{
            Number(formData.inTbBudget || 0)
          }}
        </div>
        <div v-if="[2].includes(rowIndex)">
          {{
            (Number(((formData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[3].includes(rowIndex)">
          {{ formData.inZcQtczbkBudget || 0 }}
        </div>
        <div v-if="[4].includes(rowIndex)">
          {{ formData.inZcDwBudget || 0 }}
        </div>
        <div v-if="[5].includes(rowIndex)">
          {{ formData.inZcQtBudget || 0 }}
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div
            :style="{color:((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2))  + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100) !== Number(adviceFunding)?'red':''}">
            {{
              (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2))  + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100
            }}
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">
          {{
            (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100
          }}
        </div>
        <div v-if="[8].includes(rowIndex)">
          {{
            (Number(((formData.outTbSbBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcSbBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[9].includes(rowIndex)">
          {{
            (Number(((formData.outTbYwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcYwBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[10].includes(rowIndex)">
          {{
            (Number(((formData.outTbLwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcLwBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[11].includes(rowIndex)">
          {{
            (Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))  / 100
          }}
        </div>
        <div v-if="[12].includes(rowIndex)">
          {{
            (Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[13].includes(rowIndex)">
          {{
            (Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
      </template>
      <template #tb="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">
          <div
            :style="{color: ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100) !==(Number(formData.inTbBudget  || 0) )?'red':''}">
            {{
              Number(formData.inTbBudget || 0)
            }}
          </div>

        </div>
        <div v-if="[1].includes(rowIndex)">
          {{
            Number(formData.inTbBudget || 0)
          }}
        </div>
        <div v-if="[2,3,4,5].includes(rowIndex)">
          0
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div
            :style="{color: ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100) !==(Number(formData.inTbBudget  || 0) )?'red':''}">
            {{
              (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
            }}
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">
          {{
            (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)))/100
          }}
        </div>
        <div v-if="[8].includes(rowIndex)">
          <!-- :disabled="Number(formData.inTbBudget || 0) === 0" -->
          <t-input-number  :decimal-places="2"
                          @keyup="()=>{if(formData.outTbSbBudget){formData.outTbSbBudget=Number((formData.outTbSbBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outTbSbBudget"></t-input-number>
        </div>
        <div v-if="[9].includes(rowIndex)">
          <t-input-number  :decimal-places="2"
                          @keyup="()=>{if(formData.outTbYwBudget){formData.outTbYwBudget=Number((formData.outTbYwBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outTbYwBudget"></t-input-number>
        </div>
        <div v-if="[10].includes(rowIndex)">
          <t-input-number  :decimal-places="2"
                          @keyup="()=>{if(formData.outTbLwBudget){formData.outTbLwBudget=Number((formData.outTbLwBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outTbLwBudget"></t-input-number>
        </div>
        <div v-if="[11].includes(rowIndex)">
          {{
            (Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
          }}
        </div>
        <div v-if="[12].includes(rowIndex)">
          <t-input-number  :decimal-places="2"
                          @keyup="()=>{if(formData.outTbGlBudget){formData.outTbGlBudget=Number((formData.outTbGlBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outTbGlBudget"></t-input-number>
        </div>
        <div v-if="[13].includes(rowIndex)">
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outTbJxzcBudget){formData.outTbJxzcBudget=Number((formData.outTbJxzcBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outTbJxzcBudget"></t-input-number>
        </div>
      </template>
      <template #zc="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">
          <div :style="{color: ((Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)) )/100) !== (Number(formData.inZcBudget  || 0) )?'red':''}">
            {{
              Number(formData.inZcBudget || 0)
            }}
          </div>
        </div>
        <div v-if="[1].includes(rowIndex)">
          0
        </div>
        <div v-if="[2].includes(rowIndex)"
             :style="{color:((Number(((formData.inZcQtczbkBudget || 0)*100).toFixed(2)) + Number(((formData.inZcDwBudget || 0)*100).toFixed(2)) + Number(((formData.inZcQtBudget || 0)*100).toFixed(2)))/100) !== Number(formData.inZcBudget   || 0)?'red':''}">
          {{
            (Number(((formData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
          }}
        </div>
        <div v-if="[3].includes(rowIndex)">
          <!-- :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.inZcQtczbkBudget){formData.inZcQtczbkBudget=Number((formData.inZcQtczbkBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.inZcQtczbkBudget"></t-input-number>
        </div>
        <div v-if="[4].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.inZcDwBudget){formData.inZcDwBudget=Number((formData.inZcDwBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.inZcDwBudget"></t-input-number>
        </div>
        <div v-if="[5].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.inZcQtBudget){formData.inZcQtBudget=Number((formData.inZcQtBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.inZcQtBudget"></t-input-number>
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div :style="{color: ((Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100) !== (Number(formData.inZcBudget  || 0) )?'red':''}">
            {{
              (Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
            }}
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">
          {{
            (Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100
          }}
        </div>
        <div v-if="[8].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outZcSbBudget){formData.outZcSbBudget=Number((formData.outZcSbBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outZcSbBudget"></t-input-number>
        </div>
        <div v-if="[9].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outZcYwBudget){formData.outZcYwBudget=Number((formData.outZcYwBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outZcYwBudget"></t-input-number>
        </div>
        <div v-if="[10].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outZcLwBudget){formData.outZcLwBudget=Number((formData.outZcLwBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outZcLwBudget"></t-input-number>
        </div>
        <div v-if="[11].includes(rowIndex)">
          {{
            (Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
          }}
        </div>
        <div v-if="[12].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outZcGlBudget){formData.outZcGlBudget=Number((formData.outZcGlBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outZcGlBudget"></t-input-number>
        </div>
        <div v-if="[13].includes(rowIndex)">
          <!--  :disabled="Number(formData.inZcBudget || 0) === 0" -->
          <t-input-number :decimal-places="2"
                          @keyup="()=>{if(formData.outZcJxzcBudget){formData.outZcJxzcBudget=Number((formData.outZcJxzcBudget || 0).toString().match(/^\d+(?:\.\d{0,2})?/))}}"
                          :allowInputOverLimit="false" style="width: 100%" theme="normal" clearable
                          :min="0"
                          v-model="formData.outZcJxzcBudget"></t-input-number>
        </div>
      </template>
    </t-table>
    <t-table v-else :headerAffixedTop="{ offsetTop: 0, zIndex: 1000,container: getContainer2 }"
             rowKey="index" bordered :data="data" :columns="columns">
      <template #subject="{ row,rowIndex }">
        <div v-if="[0,6].includes(rowIndex)" style="display: flex;justify-content: flex-start">
          {{ row.subject }}
        </div>
        <div v-else-if="[7,11].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 16px">
          {{ row.subject }}
        </div>
        <div v-else-if="[1,2].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;align-items: center;margin-left: 28px">
          {{ row.subject }}
        </div>
        <div v-else-if="[8, 9,10,12,13].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;align-items: center;margin-left: 40px">
          {{ row.subject }}
        </div>
        <div v-else-if="[3].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 50px">
          {{ row.subject }}
        </div>
        <div v-else-if="[4,5].includes(rowIndex)"
             style="display: flex;justify-content: flex-start;margin-left: 92px">
          {{ row.subject }}
        </div>
      </template>
      <template #hj="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">

          <div style="display: flex;justify-content: center;align-items: center">
            {{(Number(((formData.inTbBudget || 0)*100).toFixed(2)) + Number(((formData.inZcBudget || 0)*100).toFixed(2)))/100}}
            <div
              v-if="reviewOpen && contrastOpen && (Number(((formData.inTbBudget || 0)*100).toFixed(2)) + Number(((formData.inZcBudget || 0)*100).toFixed(2)))/100 !== (Number(((baseData.inTbBudget || 0)*100).toFixed(2)) + Number(((baseData.inZcBudget || 0)*100).toFixed(2)))/100"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.inTbBudget || 0) * 100).toFixed(2)) + Number(((baseData.inZcBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>

        </div>
        <div v-if="[1].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inTbBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inTbBudget !== baseData.inTbBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inTbBudget }}
            </div>
          </div>
        </div>
        <div v-if="[2].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.inZcQtczbkBudget || 0)*100).toFixed(2)) + Number(((formData.inZcDwBudget || 0)*100).toFixed(2)) + Number(((formData.inZcQtBudget || 0)*100).toFixed(2)))/100) !== ((Number(((baseData.inZcQtczbkBudget || 0)*100).toFixed(2)) + Number(((baseData.inZcDwBudget || 0)*100).toFixed(2)) + Number(((baseData.inZcQtBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((baseData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((baseData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[3].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcQtczbkBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inZcQtczbkBudget !== baseData.inZcQtczbkBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcQtczbkBudget }}
              }}
            </div>
          </div>
        </div>
        <div v-if="[4].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcDwBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inZcDwBudget !== baseData.inZcDwBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcDwBudget }}
            </div>
          </div>
        </div>
        <div v-if="[5].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcQtBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inZcQtBudget !== baseData.inZcQtBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcQtBudget }}
            </div>
          </div>
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
            (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((formData.outTbGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((formData.outTbGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100
 !== ((Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100
)/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
              (Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2))  + Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2))  + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100 !== (Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2))  + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>

        </div>
        <div v-if="[8].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbSbBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcSbBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbSbBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcSbBudget || 0) * 100).toFixed(2))) / 100) !== ((Number(((baseData.outTbSbBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcSbBudget || 0) * 100).toFixed(2))) / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbSbBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcSbBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[9].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbYwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcYwBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbYwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcYwBudget || 0) * 100).toFixed(2))) / 100) !== ((Number(((baseData.outTbYwBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0) * 100).toFixed(2))) / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbYwBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[10].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbLwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcLwBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbLwBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcLwBudget || 0) * 100).toFixed(2))) / 100) !== ((Number(((baseData.outTbLwBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0) * 100).toFixed(2))) / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbLwBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[11].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))  / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2)))  / 100) !== ((Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2)))  / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))  + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2)))  / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[12].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcGlBudget || 0) * 100).toFixed(2))) / 100) !== ((Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))) / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbGlBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcGlBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[13].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbJxzcBudget || 0) * 100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0) * 100).toFixed(2))) / 100) !== ((Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2))) / 100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbJxzcBudget || 0) * 100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
      </template>
      <template #tb="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inTbBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inTbBudget !== baseData.inTbBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inTbBudget }}
            </div>
          </div>
        </div>
        <div v-if="[1].includes(rowIndex)">
          <!--          {{ formData.inTbBudget || 0 }}-->
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inTbBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inTbBudget !== baseData.inTbBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inTbBudget }}
            </div>
          </div>
        </div>
        <div v-if="[2,3,4,5].includes(rowIndex)">
          0
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100 ) !== ((Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
              (Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">

          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((formData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((formData.outTbLwBudget || 0)*100).toFixed(2)))/100
) !== ((Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbLwBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[8].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outTbSbBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outTbSbBudget || 0) !== (baseData.outTbSbBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outTbSbBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[9].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outTbYwBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outTbYwBudget || 0) !== (baseData.outTbYwBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outTbYwBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[10].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outTbLwBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outTbLwBudget || 0) !== (baseData.outTbLwBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outTbLwBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[11].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((formData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
) !== ((Number(((baseData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outTbGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outTbJxzcBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[12].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outTbGlBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outTbGlBudget || 0) !== (baseData.outTbGlBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outTbGlBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[13].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outTbJxzcBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outTbJxzcBudget || 0) !== (baseData.outTbJxzcBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outTbJxzcBudget || 0 }}
            </div>
          </div>
        </div>
      </template>
      <template #zc="{ rowIndex }">
        <div v-if="[0].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcBudget }}
            <div v-if="reviewOpen && contrastOpen && formData.inZcBudget !== baseData.inZcBudget" class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcBudget }}
            </div>
          </div>
        </div>
        <div v-if="[1].includes(rowIndex)">
          0
        </div>
        <div v-if="[2].includes(rowIndex)">

          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((formData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.inZcQtczbkBudget || 0)*100).toFixed(2)) + Number(((formData.inZcDwBudget || 0)*100).toFixed(2)) + Number(((formData.inZcQtBudget || 0)*100).toFixed(2)))/100) !== ((Number(((baseData.inZcQtczbkBudget || 0)*100).toFixed(2)) + Number(((baseData.inZcDwBudget || 0)*100).toFixed(2)) + Number(((baseData.inZcQtBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.inZcQtczbkBudget || 0) * 100).toFixed(2)) + Number(((baseData.inZcDwBudget || 0) * 100).toFixed(2)) + Number(((baseData.inZcQtBudget || 0) * 100).toFixed(2))) / 100
              }}
            </div>
          </div>
        </div>
        <div v-if="[3].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcQtczbkBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.inZcQtczbkBudget || 0) !== (baseData.inZcQtczbkBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcQtczbkBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[4].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcDwBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.inZcDwBudget || 0) !== (baseData.inZcDwBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcDwBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[5].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.inZcQtBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.inZcQtBudget || 0) !== (baseData.inZcQtBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.inZcQtBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[6].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100) !== ((Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                 (Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[7].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((formData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((formData.outZcLwBudget || 0)*100).toFixed(2)))/100
) !== ((Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outZcSbBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcYwBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcLwBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[8].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outZcSbBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outZcSbBudget || 0) !== (baseData.outZcSbBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outZcSbBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[9].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outZcYwBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outZcYwBudget || 0) !== (baseData.outZcYwBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outZcYwBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[10].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outZcLwBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outZcLwBudget || 0) !== (baseData.outZcLwBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outZcLwBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[11].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{
              (Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
            }}
            <div
              v-if="reviewOpen && contrastOpen && ((Number(((formData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((formData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
) !== ((Number(((baseData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0)*100).toFixed(2)))/100)"
              class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{
                (Number(((baseData.outZcGlBudget || 0)*100).toFixed(2)) + Number(((baseData.outZcJxzcBudget || 0)*100).toFixed(2)))/100
              }}
            </div>
          </div>
        </div>
        <div v-if="[12].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outZcGlBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outZcGlBudget || 0) !== (baseData.outZcGlBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outZcGlBudget || 0 }}
            </div>
          </div>
        </div>
        <div v-if="[13].includes(rowIndex)">
          <div style="display: flex;justify-content: center;align-items: center">
            {{ formData.outZcJxzcBudget || 0 }}
            <div v-if="reviewOpen && contrastOpen && (formData.outZcJxzcBudget || 0) !== (baseData.outZcJxzcBudget || 0)"
                 class="exception-data">
              <t-icon style="margin: 0px 5px" name="arrow-left"/>
              {{ baseData.outZcJxzcBudget || 0 }}
            </div>
          </div>
        </div>
      </template>
    </t-table>
  </div>

</template>

<script>
export default {
  name: "project-budget",
  props: {
    value: Object,
    projectId: [String, Number],
    editOpen: {
      type: Boolean,
      default: false
    },
    reviewOpen: {
      type: Boolean,
      default: false
    },
    phaseType: {
      type: String,
      default: '1'
    },
    fundingObj: {
      type: Object,
      default: () => ({subsidyFunding: 0, adviceFunding: 0})
    },
    container: {
      type: String,
      default: '.jxkj-layout'
    },
    contrastOpen: {
      type: Boolean,
      default: false
    },
    useOldData: {
      type: Boolean,
      default: false
    },
    useBaseData: {
      type: Boolean,
      default: false
    },
    oldData: {
      type: Object,
      default: () => {}
    },
  },
  data() {
    return {
      zcFunding: null,
      site_tag: import.meta.env.VITE_SITE_TAG,
      adviceFunding: 0,
      baseData: {
        inTbBudget: 0,
        inZcBudget: 0,
        inZcQtczbkBudget: 0,
        inZcDwBudget: 0,
        inZcQtBudget: 0,
        outTbSbBudget: 0,
        outZcSbBudget: 0,
        outTbYwBudget: 0,
        outZcYwBudget: 0,
        outTbLwBudget: 0,
        outZcLwBudget: 0,
        outTbGlBudget: 0,
        outZcGlBudget: 0,
        outTbJxzcBudget: 0,
        outZcJxzcBudget: 0,
      },
      formData: {
        phaseType: this.phaseType,
        inTbBudget: 0,
        inZcBudget: 0,
        inZcQtczbkBudget: 0,
        inZcDwBudget: 0,
        inZcQtBudget: 0,
        outTbSbBudget: 0,
        outZcSbBudget: 0,
        outTbYwBudget: 0,
        outZcYwBudget: 0,
        outTbLwBudget: 0,
        outZcLwBudget: 0,
        outTbGlBudget: 0,
        outZcGlBudget: 0,
        outTbJxzcBudget: 0,
        outZcJxzcBudget: 0,
      },
      data: [
        {
          index: 1,
          subject: "一、经费来源",
        },
        {
          index: 2,
          subject: import.meta.env.VITE_SITE_TAG === 'jtt' ? "1、厅拨经费" : `1、集团补助经费`,
        },
        {
          index: 3,
          subject: "2、自筹经费",
        },
        {
          index: 4,
          subject: "其中：其他财政拨款",
        },
        {
          index: 5,
          subject: "单位自筹",
        },
        {
          index: 6,
          subject: "其他（注明来源）",
        },
        {
          index: 7,
          subject: "二、经费支出",
        },
        {
          index: 8,
          subject: "（一）直接费用",
        },
        {
          index: 9,
          subject: "1、设备费",
        },
        {
          index: 10,
          subject: "2、业务费",
        },
        {
          index: 11,
          subject: "3、劳务费",
        },
        {
          index: 12,
          subject: "（二）间接费用",
        },
        {
          index: 13,
          subject: "1、管理费",
        },
        {
          index: 14,
          subject: "2、绩效支出",
        },
      ],
      columns: [
        {
          colKey: "subject",
          title: "科目",
          align: "center"
        },
        {
          colKey: "hj",
          title: `合计`,
          align: "center"
        },
        {
          colKey: "tb",
          title: import.meta.env.VITE_SITE_TAG === 'jtt' ? "厅拨经费" : "集团补助经费",
          align: "center"
        },
        {
          colKey: "zc",
          title: "自筹经费",
          align: "center"
        },
      ]
    }
  },
  computed: {
    offsetTop() {
      return this.$store.state.setting.isUseTabsRouter ? 30 : 0;
    },
  },
  watch: {
    value: {
      deep: true,
      immediate: true,
      handler(val) {
        if(val && this.useOldData){
          Object.assign(this.formData, val);
        }
      }
    },
    projectId: {
      immediate: true,
      handler(val) {
        if (val) {
          this.getBudget(val);
        }
      }
    },
    formData: {
      deep: true,
      immediate: true,
      handler(val) {
        this.$emit("input", val);
      }
    },
    oldData:{
      deep: true,
      immediate: true,
      handler(val) {
        if(this.useOldData){
          Object.assign(this.baseData, this.oldData);
        }
      }
    },
  },
  created() {

  },
  methods: {
    getContainer() {
      return document.querySelector('.jxkj-layout');
    },
    getContainer2() {
      if(this.useOldData){
        return  '';
      }
      const list = document.getElementsByClassName('t-tab-panel');
      let number = 1;
      if (this.phaseType === '1' && list.length === 3) {
        number = 2
      }
      return list[list.length - number];
    },
    async getBudget() {
      if (!this.projectId) {
        return false;
      }
      if(this.phaseType === '1'){
        await this.$api.kjxm.project.get(Number(this.projectId)).then(response => {
          this.adviceFunding = response.data.adviceFunding
          this.formData.inTbBudget = response.data.subsidyFunding;
          this.formData.inZcBudget = (Number(((response.data.adviceFunding || 0) * 100).toFixed(2)) - Number(((response.data.subsidyFunding || 0) * 100).toFixed(2))) / 100;
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      }else if(this.phaseType === '3'){
        await this.$api.kjxm.contract.getByProject(Number(this.projectId)).then(response => {
          this.adviceFunding = response.data.adviceFunding
          this.formData.inTbBudget = response.data.subsidyFunding;
          this.formData.inZcBudget = (Number(((response.data.adviceFunding || 0) * 100).toFixed(2)) - Number(((response.data.subsidyFunding || 0) * 100).toFixed(2))) / 100;
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      }


      if(!this.useOldData){
        // 如果 reviewOpen 打开则查询当前阶段的前一个阶段值做对比
        if (Number(this.phaseType) !== 1 && this.reviewOpen) {
          let lastStep = Number(this.phaseType) - 1 > 0 ? Number(this.phaseType) - 1 : 1
          if(this.phaseType === '3'){
            lastStep = 1
          }
          this.$api.kjxm.project.budgetGet(Number(this.projectId), lastStep).then(response => {
            response.data = response.data || {}
            // if (Object.prototype.hasOwnProperty.call(response.data, "inTbBudget")) {
            //   delete response.data.inTbBudget;
            // }
            // if (Object.prototype.hasOwnProperty.call(response.data, "inZcBudget")) {
            //   delete response.data.inZcBudget;
            // }
            Object.assign(this.baseData, response.data);

          }).catch((e) => {
            this.$message.error(e.toString());
          });
        }
      }
      if(this.useOldData){
        return false;
      }
      this.$api.kjxm.project.budgetGet(Number(this.projectId), this.phaseType).then(response => {
        response.data = response.data || {}
        if (!response.data.id && this.phaseType !== '1' && this.editOpen === true) { // 获取不到读申报项目的经费
          let lastStep = Number(this.phaseType) - 1 > 0 ? Number(this.phaseType) - 1 : 1
          if(this.phaseType === '3'){
            lastStep = 1
          }

          this.$api.kjxm.project.budgetGet(Number(this.projectId), lastStep).then(response2 => {
            response2.data = response2.data || {}
            if (Object.prototype.hasOwnProperty.call(response2.data, "inTbBudget")) {
              delete response2.data.inTbBudget;
            }
            if (Object.prototype.hasOwnProperty.call(response2.data, "inZcBudget")) {
              delete response2.data.inZcBudget;
            }
            Object.assign(this.formData, response2.data);
            this.formData.phaseType = this.phaseType;
            this.$emit("input", this.formData);
          }).catch((e) => {
            this.$message.error(e.toString());
          });
        } else {
          if (Object.prototype.hasOwnProperty.call(response.data, "inTbBudget")) {
            delete response.data.inTbBudget;
          }
          if (Object.prototype.hasOwnProperty.call(response.data, "inZcBudget")) {
            delete response.data.inZcBudget;
          }
          Object.assign(this.formData, response.data || {});
          this.formData.phaseType = this.phaseType;
          this.$emit("input", this.formData);
        }
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
  },

}
</script>

<style scoped>
::v-deep .t-table__affixed-header-elm {
  overflow: hidden;
}

.exception-data {
  color: red;
  height: 100%;
  display: flex;
  align-items: center
}
</style>
